import React from 'react'
import PropTypes from 'prop-types'
import { View, Text, StyleSheet, Image } from 'react-native'
import { ScaleT, ScaleS } from 'src/utils/ScreenUtil'
import CustomImage from 'src/components/image/CustomImage'
import CustomButton from 'src/components/button/CustomButton'
import { ServiceTelephone } from 'src/config/index'

const triangleArrowRight = require('@/imgC/userinfo/arrow_black_right.png')

export default class CompanyOtherList extends React.PureComponent {
  static propTypes = {
    onClick: PropTypes.func
  }

  render () {
    const { onClick } = this.props
    return (
      <View style={styles.container}>
        <CustomButton
          style={[styles.cell, styles.bottomLine]}
          params={0}
          onPress={onClick}
        >
          <View style={styles.titWrap}>
            <Text style={styles.tit}>客服咨询</Text>
            <Text style={styles.desc}>{ServiceTelephone}</Text>
          </View>
          <CustomImage
            style={styles.img}
            source={triangleArrowRight}
          />
        </CustomButton>
        <CustomButton
          style={styles.cell}
          params={1}
          onPress={onClick}
        >
          <View style={styles.titWrap}>
            <Text style={styles.tit}>订单记录</Text>
            <Text style={styles.desc}>查看订单记录</Text>
          </View>
          <CustomImage
            style={styles.img}
            source={triangleArrowRight}
          />
        </CustomButton>
      </View>
    )
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    marginTop: ScaleS(30),
    marginHorizontal: ScaleS(20)
  },
  cell: {
    height: ScaleS(90),
    flexDirection: 'row',
    justifyContent: 'space-between',
    alignItems: 'center'
  },
  bottomLine: {
    borderBottomWidth: ScaleS(1),
    borderStyle: 'solid',
    borderColor: 'rgba(120, 120, 120, .1)'
  },
  titWrap: {
    justifyContent: 'center'
  },
  tit: {
    fontSize: ScaleT(19),
    fontWeight: '500',
    color: '#444444',
    lineHeight: ScaleS(32)
  },
  desc: {
    fontSize: ScaleT(12),
    fontWeight: '400',
    color: '#A5A5A5',
    lineHeight: ScaleS(23)
  }
})
